package dev.ideas.funkyj.sequence;

import org.junit.Test;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;

import static dev.ideas.funkyj.sequence.Sequence.from;
import static dev.ideas.funkyj.support.PredicateSupport.string;
import static org.junit.Assert.assertEquals;

/**
 */
public class As {

    @Test public void to() {
        final Sequence<String> sequence = from(1, 2).to(string);
        final List<String> strings = Arrays.asList("1", "2");

        assertEquals(sequence.asList(), strings);
        assertEquals(sequence.asArray(), strings.toArray());
        assertEquals(sequence.asSet(), new HashSet<String>(strings));
    }

}
